/**
 * 伪代码 打平路由思想
 */
let routes = <Routes>
  {/* 每个 Route 组件代表一个路由规则 */}
  <Route path='/user' element={<User></User>}>
    <Route path="add" element={<UserAdd></UserAdd>}></Route>
    <Route path="list" element={<UserList></UserList>}></Route>
    <Route path="detail/:id" element={<UserDetail></UserDetail>}></Route>
  </Route>
</Routes>

// 把上面的多维结构变成一维结构
let branches = [
  { path: '/user' },
  { path: '/user/add' },
  { path: '/user/list' },
  { path: "/user/detail/:id" },
]

// 并且还会对分支进行排序 子路由在前 父路由在后
let sortedBranches = [
  { path: '/user/add' },
  { path: '/user/list' },
  { path: "/user/detail/:id" },
  
  { path: '/user' },
]

// 然后浏览器地址进行逐级匹配
let pathname=  '/user/add'
